/*
 * @Author: your name
 * @Date: 2021-02-23 13:34:19
 * @LastEditTime: 2021-04-09 17:05:31
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 */
import { defineComponent, reactive, ref } from 'vue';
import { FormSchema } from 'comps/form';
export default defineComponent({
  name: 'GarbageCalculation',
  setup() {
    const model = reactive({
      socialCreditCode: '',
      test: '',
      type: '',
    });
    const schemas = ref<FormSchema[]>([
      { key: 'socialCreditCode', label: '信用代码', component: 'Input' },
      { key: 'test', label: '测试时间', component: 'DatePicker' },
      {
        key: 'type',
        label: '类型',
        component: 'Select',
        props: {
          options: [
            { label: '电商', value: 'a' },
            { label: '实体店', value: 'b' },
          ],
        },
      },
    ]);

    const handleSubmit = () => {
      console.log(model);
    };

    return () => {
      return (
        <div class="py-10px px-20px w-full rounded-4px shadow-lg bg-white">
          <yan-form v-model={model} schemas={schemas.value} column={4}></yan-form>
          <a-button
            onClick={() => {
              handleSubmit();
            }}
          >
            查询
          </a-button>
        </div>
      );
    };
  },
});
